怎样把"headima/1.gif"把其中的1换成一个变量

来源:百度知道 编辑:UC知道 时间:2024/05/18 05:39:08
我是这样写的
"headima/"&document.form1.headpath.vaule&".gif"
没有连接成功
请高兄帮忙啊

你这个是javascript还是vbscript??

<body>
<input id="StrTxt" type="text">
<input onclick="ImgC()" type="button">
<img id="Img" src="http://img.baidu.com/img/logo-zhidao.gif">
<script>
function ImgC(){
Img.src="headima/"+document.getElementById("StrTxt").value+".gif"
}
</script>
</body>

自己慢慢试。。。我帮你写好了。